def PrintAnswers(num, nowNum=1, sum_=0):
    if num == 0:  # 如果最后数字减到0，那就得出一种解法
        sum_ += 1
    
    for i in range(nowNum, num+1):
        sum_ = PrintAnswers(num-i, i, sum_)
        '''
        用num = 3举例:
			第一解法:
				先一路“递”到底:
					3 = 1 + 1 + 1
					sum_ = 1
			返回一格:
				3 = 1 + i
			第二解法:
				递（使用for循环，不重复）:
					i = 2
					3 = 1 + 2
					sum_ = 2
        '''
    
    return sum_

while True:
	n = input('Enter the number you want to decompose. ')
	try:
		int(n)
	except ValueError:
		print('Input a number,please.')
	else:
		n = int(n)
		break

print(
	f'There are \
{PrintAnswers(n)-1} \
decomposition methods for this number'
)
